/**
 * 
 */
package neptune.web.server.operations;

import neptune.manager.NeptuneManager;
import neptune.web.server.ApplicationManager;
import it.robertobifulco.ias.IncorrectParamsException;
import it.robertobifulco.ias.Operation;

/**
 * @author Roberto Bifulco [info@robertobifulco.it, robertobifulco.it]
 * 
 */
public class DeleteExperiment implements Operation {

	public static String ID = "DeleteExperiment";

	/*
	 * (non-Javadoc)
	 * 
	 * @see it.robertobifulco.ias.Operation#execute(java.lang.Object[])
	 */
	/**
	 * @param args[0] =
	 *            String expId
	 * @return null
	 */
	public Object[] execute(Object[] args) throws IncorrectParamsException,
			Exception 
	{

		String expName = (String) args[0];

		ApplicationManager manager = ApplicationManager.getApplicationManager();
		NeptuneManager expManager = manager.getNeptuneManager();

		boolean isRemoved = expManager.deleteExperiment(expName);

		return new Object[]{new Boolean(isRemoved)};
	}

	/*
	 * (non-Javadoc)
	 * 
	 * @see it.robertobifulco.ias.Operation#getDescription()
	 */
	public String getDescription() {
		return "Delete experiment operation";
	}

	/*
	 * (non-Javadoc)
	 * 
	 * @see it.robertobifulco.ias.Operation#getID()
	 */
	public String getID() {
		return ID;
	}

}
